import React, { memo } from 'react';
import PropTypes from 'prop-types';
import { Button } from 'antd';

const VoteFooter = (props) => {
    console.log('voteFooter RENDER');
    return (
        <div>
            <Button type="primary" onClick={() => props.change('up')}>投票</Button>
            <Button type="primary" danger onClick={() => props.change('down')}>反对</Button>
        </div>
    );
};


VoteFooter.propTypes = {
    change: PropTypes.func.isRequired,
};

// memo=>缓存组件
export default memo(VoteFooter);
